package biz;

import bean.*;
import mapper.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseBizImpl implements CourseBiz {
    @Autowired
    private CourseMapper cm;

    @Override
    public void InsertData(CourseTest ct) {
         cm.InsertData(ct);
    }

    //找到公司号
    public Integer findCompaneId(int usersId){
        return cm.findCompaneId(usersId);
    }

    @Override
    public List<courseDetailInfo> CourseCatalogue(courseDetailInfo cdi) {
        return cm.CourseCatalogue(cdi);
    }

    @Override
    public List<CourseUserList> findOneCourse(CourseUserList ci) {
        return cm.findOneCourse(ci);
    }

    @Override
    public List<CourseUserList> findOneCourse1(CourseUserList ci) {
        return cm.findOneCourse1(ci);
    }

    //找到此用户的所有课程
    public List<CourseInfo> findAllCourse(int companyId) {
        return cm.findAllCourse(companyId);
    }

    //课程的详细列表
    public List<courseDetailInfo> findCourseDetail(int courseId) {
        return cm.findCourseDetail(courseId);
    }

    public Integer findIsAllDoneCount(int usersId) {
        return cm.findIsAllDoneCount(usersId);  //现完成课程数
    }

    public Integer findAllDoneCount(int usersId) {
        return cm.findAllDoneCount(usersId);  //总课程数
    }

    public List<CourseUserList> recentLearning(int usersId) {
        return cm.recentLearning(usersId);  //最近学习的课程
    }

    //保存时间
    public void StorageTime(CourseUserList ci) {
            cm.StorageTime(ci);
    }

    //修改课程状态
    public void updateCourseState(CourseUserList ci) {
              cm.updateCourseState(ci);
    }

    //修改目录状态：需要用户号，课程号以及目录号
    public void updateCataloguetate(CourseUserList cdi) {
        cm.updateCataloguetate(cdi);
    }

    @Override
    public void updateCataLOgueTime(CourseUserList cdi) {
           cm.updateCataLOgueTime(cdi);
    }

    public String findStudyGroupName(StudygroupnumberInfo sgi){
          return cm.findStudyGroupName(sgi);
    }//查找学组姓名

    public String findCompanyName(int companyId){
         return cm.findCompanyName(companyId);
    }//查找学组姓名
}
